package app

import (
	"d-serv-go/server/core/comm"
	"d-serv-go/server/core/conf"
	"d-serv-go/server/core/dict"
	"d-serv-go/server/core/log"
	"d-serv-go/server/core/menu"
	"d-serv-go/server/core/org"
	"d-serv-go/server/core/serv"
	"d-serv-go/server/core/user"
	"d-serv-go/server/da"
)

// regist system level service
func RegServs() {
	// 匿名函数返回ServAop接口的对象
	serv.RegistServ("CommonServ", func() serv.ServAop { return &serv.CommServ{} })
	// sy
	serv.RegistServ("ServDef", func() serv.ServAop { return &serv.ServDef{} })
	serv.RegistServ("DictServ", func() serv.ServAop { return &dict.DictServ{} })
	serv.RegistServ("OrgServ", func() serv.ServAop { return &org.OrgServ{} })
	serv.RegistServ("UserServ", func() serv.ServAop { return &org.UserServ{} })
	serv.RegistServ("ConfServ", func() serv.ServAop { return &conf.ConfServ{} })
	serv.RegistServ("LoginServ", func() serv.ServAop { return &user.LoginServ{} })
	serv.RegistServ("InfoServ", func() serv.ServAop { return &comm.InfoServ{} })
	serv.RegistServ("AppServ", func() serv.ServAop { return &comm.AppServ{} })
	serv.RegistServ("MenuServ", func() serv.ServAop { return &menu.MenuServ{} })
	// org
	serv.RegistServ("DeptServ", func() serv.ServAop { return &org.DeptServ{} })
	serv.RegistServ("RoleUserServ", func() serv.ServAop { return &org.RoleUserServ{} })
	serv.RegistServ("RoleServ", func() serv.ServAop { return &org.RoleServ{} })
	// co
	
	// da
	serv.RegistServ("DataSetServ", func() serv.ServAop { return &da.DataSetServ{} })
	serv.RegistServ("DataSetFieldServ", func() serv.ServAop { return &da.DataSetFieldServ{} })
	serv.RegistServ("DataSetVirJSONServ", func() serv.ServAop { return &da.DataSetVirJSONServ{} })
	serv.RegistServ("DataSourceServ", func() serv.ServAop { return &da.DataSourceServ{} })
	serv.RegistServ("DataViewServ", func() serv.ServAop { return &da.DataViewServ{} })
	// rpt

	//...
}

// regist rpc services
func RegRpc() {
	log.Info("regist rpc...")
}
